package com.zrrd.exception;

import com.zrrd.util.Result;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;


@ControllerAdvice("com.zrrd")
public class GlobalExceptionHandler {

    @ResponseBody
    @ExceptionHandler(Exception.class)
    public Result exception(Exception e) {
        System.out.println("GlobalExceptionHandler" + e);
        return Result.fail(-1, e.getMessage());
    }
}
